package cn.hdustea.shopNavigation.ui.presenter

import cn.hdustea.shopNavigation.entity.Beauty
import cn.hdustea.shopNavigation.ui.contract.BeautyContract
import cn.hdustea.shopNavigation.ui.model.BeautyModel
import com.hdustea.base.base.BasePresenter

/**
 * <pre>
 *     author : HuQiang
 *     time   : 2020/09/21
 *     desc   :
 *     version: 1.0
 * </pre>
 */
class BeautyPresenter(mView: BeautyContract.View) : BasePresenter<BeautyContract.View, BeautyContract.Model>(mView), BeautyContract.Presenter {

    override fun getModel(): BeautyContract.Model = BeautyModel()

    override fun getBeautyList(page: Int, isRefresh: Boolean) {
        mModel.getBeautyList(page, object : PresenterCallback<MutableList<Beauty>>() {

            override fun callback(data: MutableList<Beauty>) {
                mView?.dismissLoading()
                mView?.setBeautyList(data, isRefresh)
            }

        })
    }


} 